package cn.intotw.rdcj.core.config;

import cn.intotw.rdcj.core.compoment.RocketMqCompoment;
import com.google.gson.Gson;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by Chenxiang
 *
 * @generator: IntelliJ IDEA
 * @description: RocketMq配置
 * @project: rdcj
 * @package: cn.intotw.rdcj.core.config
 * @date: 2021年04月29日 09时26分
 */
@Configuration
@ConditionalOnClass(RocketMQTemplate.class)
public class RocketMqConfig {


    @Bean
    @ConditionalOnBean(RocketMQTemplate.class)
    public RocketMqCompoment rocketMqCompoment(Gson gson,RocketMQTemplate rocketMQTemplate){
        return new RocketMqCompoment(rocketMQTemplate,gson);
    }
}
